package model.resource;

public class NonRenewableResource extends Resource
{
	private int quantity;
	
	public NonRenewableResource(String type, int initQuantity)
	{
		super(type);
		quantity = initQuantity;
	}
	
	public int getQuantity()
	{
		return quantity;
	}

	public int harvest(int amount)
	{
		if (amount > quantity)
		{
			amount = quantity;
			quantity = 0;
		}
		else
			quantity -= amount;
		
		return amount;
	}
}
